#ifndef GSPLOTCONTROL_H
#define GSPLOTCONTROL_H

#include "gsplot.h"
#include <QObject>

class GSPlotControl : public QObject
{
    Q_OBJECT
    Q_ENUMS(CtlType)
public:
    enum CtlType{DEL, FORWARD, BACK, NOCTL}; //Control Function
    explicit GSPlotControl(GSPlot* gsp, QObject *parent = 0);
    GSPlotControl::CtlType getCtlType();    

signals:
    void plotCtlMenu(GSPlot* gsp, GSPlotControl::CtlType type);

private slots:
    void popPlotEditMenu(const QPoint &pos);
    void settingPreferences();
    void titleDoubleClick(QMouseEvent *event, QCPPlotTitle *title);
    void axisLabelDoubleClick(QCPAxis* axis, QCPAxis::SelectablePart part);
    void legendDoubleClick(QCPLegend* legend, QCPAbstractLegendItem* item);
    void selectionChanged();
    void mousePress();
    void mouseWheel();
    void moveLegend();
    void roomDefault();
    void savePlotFile();
    void clearPlot();
//    void graphClicked(QCPAbstractPlottable *plottable);

private:
    GSPlot* inPlot;
};

#endif // GSPLOTCONTROL_H
